<?
// +----------------------------------------------------------------------
// | 软终端使用权限配置
// +----------------------------------------------------------------------
// | Author: TongBC <50249101@qq.com>
// +----------------------------------------------------------------------
// | Date  : 2015/04/17
// +----------------------------------------------------------------------
include '/var/www/html/new/d/common/header.html';
include '/var/www/html/new/d/common/left.html';
// include '/var/www/html/new/d/common/page.php';
include '/var/www/html/new/d/common/autoload.php';
include '/var/www/html/new/d/common/Prod_Common.php';



// 身份验证
if(!in_array($_SESSION['sdtype'], array(0,2,6,9))) exit('身份不合法');

$sql = "SELECT terminal_type FROM pft_member_extinfo WHERE fid={$_SESSION['sid']} LIMIT 1";
$GLOBALS['le']->query($sql);
$GLOBALS['le']->fetch_assoc();
$global_terminal_set = $GLOBALS['le']->f('terminal_type');//终端类型——针对产品0启用1不启用

// $currentPage = $_REQUEST["currentPage"] ? $_REQUEST["currentPage"]:1;
// $pageSize = $_REQUEST['pageSize'] ? $_REQUEST["pageSize"]:15;
// $start = ($currentPage-1)*$pageSize;
// 获取产品
$where = " AND apply_did={$_SESSION['sid']}";


$sql = <<<SQL
SELECT id,title,salerid,terminal,p_type,terminal_type,apply_did FROM uu_land
WHERE 1=1 {$where} AND status=1 ORDER BY id ASC
SQL;

if($_SESSION['sid']==1){// 管理员点击票类验证
    include("common/page.php");
    echo '<link rel="stylesheet" type="text/css" href="css/page.css"/>';
    $currentPage=$_REQUEST["currentPage"]?$_REQUEST["currentPage"]:1;
    $pageSize=$_REQUEST['pageSize']?$_REQUEST["pageSize"]:15;
    $offset = ($currentPage-1)*$pageSize;
    $sql = "SELECT id,title,salerid,terminal,p_type,terminal_type,apply_did FROM uu_land where status=1 order by id limit $offset,$pageSize";
}
$GLOBALS['le']->query($sql);
$prods = array();
while($r = $GLOBALS['le']->fetch_assoc()) {
    $prods[] = $r;
}
if($_SESSION['sid']==1){// 管理员点击票类验证
    $sql = "SELECT count(*) as total FROM uu_land where status=1 order by id ";
    $GLOBALS['le']->query($sql);
    $GLOBALS['le']->fetch_assoc();
    $count = $GLOBALS['le']->f('total');
}

$var['prods'] = $prods;// 产品信息

include '/var/www/html/new/d/tpl/terminal_chk_set.html';
include '/var/www/html/new/d/common/footer.html';
?>